package com.gitee.wsl.func.ext

import com.gitee.wsl.func.CallAbleFun
import com.gitee.wsl.func.SuspendCallAbleFun

infix fun <IP, R, P1> CallAbleFun<IP,R>.compose(f: CallAbleFun<P1,IP>): CallAbleFun<P1,R> =
    { p1 -> this(f(p1)) }

infix fun <IP, R, P1> SuspendCallAbleFun<IP,R>.compose(f: SuspendCallAbleFun<P1,IP>): SuspendCallAbleFun<P1,R> =
    { p1 -> this(f(p1)) }

infix fun <IP, R, P1> SuspendCallAbleFun<IP,R>.compose(f: CallAbleFun<P1,IP>): SuspendCallAbleFun<P1,R> =
    { p1 -> this(f(p1)) }

infix fun <IP, R, P1> CallAbleFun<IP,R>.compose(f: SuspendCallAbleFun<P1,IP>): SuspendCallAbleFun<P1,R> =
    { p1 -> this(f(p1)) }